#!/usr/bin/env bash

sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
# sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
systemctl restart sshd.service

echo "nameserver 114.114.114.114" > /etc/resolv.conf

systemctl stop firewalld.service
systemctl disable firewalld.service


yum install wget -y

wget -qO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum makecache fast

yum install epel-release -y

yum install zsh git -y
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

mv ~/.zshrc ~/.zshrc.bak
wget -q https://gitee.com/ECH0/init/raw/master/zshrc-template -O ~/.zshrc
wget -qO- https://gitee.com/ECH0/init/raw/master/oh-my-zsh.tar.gz | tar zxvf - -C ~/.oh-my-zsh/ 
chsh -s /bin/zsh
source ~/.zshrc

yum install -y ipset psmisc net-tools telnet bind-utils bzip2 ntpdate supervisor

/usr/bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -f
/usr/sbin/ntpdate ntp1.aliyun.com
echo -e "1 * * * * root /usr/sbin/ntpdate ntp1.aliyun.com > /dev/null 2>&1" >> /etc/crontab

sed -i 's/minfds=1024/minfds=1000000/' /etc/supervisord.conf
sed -i 's/minprocs=200/minprocs=1000000/' /etc/supervisord.conf
systemctl enable supervisord
systemctl start supervisord

wget -qO ~/.tmux.conf https://gitee.com/ECH0/init/raw/master/tmux.conf



systemctl enable docker
systemctl start docker 